<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<html>
	<head>
		<link href="../../../css/Public.css" type="text/css" rel="stylesheet" />
		<link href="../../../css/PublicEdit.css" type="text/css" rel="stylesheet" />
		<title>修改密码</title>
		<script>
		function checkData() {
		//验证数据   原始密码
		var userinfo_Oripassword = window.document.getElementById("userinfo_Oripassword").value;
		if (userinfo_Oripassword !=null && userinfo_Oripassword !="" ) 
		{		
			if(userinfo_Oripassword.length>18||userinfo_Oripassword.length<6)
			{
				alert("原始密码长度为6-18位！");
				window.event.returnValue = false;
				return;
			}	
		} else {
			alert("请输入原始密码！");
			window.event.returnValue = false;
			return;
		}
		//验证数据   新密码
		var userinfo_password = window.document
				.getElementById("userinfo_ksPwd").value;
		if (userinfo_password !=null && userinfo_password !="") 
		{
			if(userinfo_password.length>18||userinfo_password.length<6)
				{
					alert("新密码长度为6-18位！");
					window.event.returnValue = false;
					return;
				}	
		} else {
			alert("请输入新密码！");
			window.document.getElementById("userinfo_ksPwd").focus();
			window.event.returnValue = false;
			return;
		}
	}
</script>
	</head>
	<body>
		<form action="/admin/user/upwd" method="post">
			<input type="hidden" id="userinfo_ksUserId" name="userinfo_ksUserId"
				value="${ksuer.username}" />		
			<div>
				<div class="l_f_top">
					<div class="l_f_top_left_div">
						<img alt="" src="/images/tb.gif" width="16" height="16" />
					</div>
					<div class="l_f_top_right_div">
						修改密码
					</div>
				</div>
				<div class="l_f_body">
					<div class="l_f_body_row">
						<div class="l_f_body_div1">
							原始密码:
						</div>
						<div class="l_f_body_div5">
							<input type="password" name="userinfo_Oripassword" id="userinfo_Oripassword" size="20" />
						</div>
					</div>
					<div class="l_f_body_row">
						<div class="l_f_body_div1">
							新密码:
						</div>
						<div class="l_f_body_div5">
							<input type="password" name="userinfo_ksPwd" id="userinfo_ksPwd"
								value="" size="20" />
						</div>
					</div>
					<c:if test="${PwdResult==-1}"> 
						<div class="l_f_body_row">					  
							<div align="center" style="color:red" class="l_f_body_div1">
								原始密码错误！
							</div>						
						</div>
					</c:if>					
					<c:if test="${PwdResult==1}"> 
						<div class="l_f_body_row">					  
							<div align="center" style="color:red" class="l_f_body_div1">
								修改成功！
							</div>						
						</div>
					</c:if>
					<div class="center l_f_body_foot">
						<input type="submit" id="button" name="button" class="button2_60"
							onclick="checkData();" value="提交" />
					  <input type="button" class="button2_60"  onclick="javascript:history.go(-1);" value=" 返回"/> 
		                 </div>
				</div>
			</div>
		</form>
	</body>
</html>

